package com.intellagric.controller.portal.iftmonitor;

import com.intellagric.common.pojo.LayuiDataGridResult;
import com.intellagric.common.pojo.ResponseMessage;
import com.intellagric.module.iftmonitor.SceneVo;
import com.intellagric.pojo.IftScene;
import com.intellagric.service.iftmonitor.ift_scene.SceneService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.Date;
import java.util.List;
import java.util.UUID;

/**
 * @Author: zhy
 * @email: 1269679946@qq.com
 * @Date: 2018/10/25
 * @DESC： 场景信息管理
 */
@Controller
public class SceneController {

    @Autowired
    private SceneService sceneService;

    /**
     * 查询场景信息
     * @return IftScene
     */
    @RequestMapping("/scene/{id}")
    @ResponseBody
    public IftScene get(@PathVariable String id) {
        return sceneService.getSceneById(id);
    }

    /**
     * 多条件查询场景信息
     * @return IftScene
     */
    @RequestMapping("/scene/query")
    @ResponseBody
    public LayuiDataGridResult getByVo(SceneVo sceneVo) {
        System.out.println(sceneVo.getName());
        return sceneService.getSceneByVo(sceneVo);
    }


    /**
     * 查询场景信息列表
     * @return LayuiDataGridResult
     */
    @RequestMapping("/scene/list")
    @ResponseBody
    public LayuiDataGridResult getList() {
        return sceneService.getSceneList();
    }

    /**
     * 查询场景信息列表
     * @return LayuiDataGridResult
     */
    @RequestMapping("/scene/tree")
    @ResponseBody
    public LayuiDataGridResult getTree() {
        return sceneService.getSceneTree();
    }


}
